﻿using System;
using System.Threading;
using System.Threading.Tasks;
using K9Nano.Domain;

namespace K9Nano.Application
{
    public interface ICurdApplicationService<TEntity, in TCreateDto, in TEditDto, TItemDto, in TPagedInputDto, in TKey> 
        where TEntity : class, IEntity<TKey>
        where TEditDto : IDto<TKey>
        where TItemDto : IDto<TKey> 
        where TPagedInputDto : IPagedInputDto<TEntity>
        where TKey : IEquatable<TKey>
    {
        public Task<TItemDto> CreateAsync(TCreateDto dto, CancellationToken cancellation = default);
        public Task<TItemDto> UpdateAsync(TEditDto dto, CancellationToken cancellation = default);
        public Task<PagedResultDto<TItemDto>> ListAsync(TPagedInputDto input, CancellationToken cancellation = default);
        public Task DeleteAsync(TKey id, CancellationToken cancellation = default);
        public Task<TItemDto> GetAsync(TKey id, CancellationToken cancellation = default);
    }
}